#ifndef MAINWINDOW_H
#define MAINWINDOW_H

#include <QMainWindow>
#include <QListWidgetItem>
#include "protocol.h"
#include "settingdialog.h"

QT_BEGIN_NAMESPACE
namespace Ui { class MainWindow; }
QT_END_NAMESPACE

class MainWindow : public QMainWindow
{
    Q_OBJECT

public:
    MainWindow(QWidget *parent = nullptr);
    ~MainWindow();

private slots:

    void on_actionNew_triggered();

    void on_actionAdd_triggered();

    void on_actionDelete_triggered();

    void on_actionSave_triggered();

    void on_listWidget_ProtocolItemList_currentItemChanged(QListWidgetItem *current, QListWidgetItem *previous);

    void on_actionSaveAs_triggered();

    void on_actionSetting_triggered();

    void on_actionOpen_triggered();

    void protocolItemNameChanged(const QString name);

    void on_actionGenSDK_triggered();

private:
    Ui::MainWindow *ui;

    Protocol m_Protocol;

    void refreshProtocolItemList();
    void openGenFile(QString fileName, bool bLoad=false);


};
#endif // MAINWINDOW_H
